/*
This file is part of Darling.

Copyright (C) 2016 Lubos Dolezel

Darling is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Darling is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Darling.  If not, see <http://www.gnu.org/licenses/>.
*/

#include <CoreFoundation/CoreFoundation.h>

#ifdef __OBJC__

#import <Foundation/Foundation.h>
#import <DiskImages/DIHelperProxy.h>

#endif /* __OBJC__ */

CF_IMPLICIT_BRIDGING_ENABLED
CF_EXTERN_C_BEGIN

typedef struct {
	char *fUDIFSignature;
	int fUDIFVersion;
	int fUDIFCodeSignOffset;
	int fUDIFCodeSignLength;
} UDIFFileHeader;

#define kUDIFSignature "UDIFSignature"

void* DIADCCompressorCalculateBufferSize(void);
void* DIADCCompressorCompressData(void);
void* DIADCCompressorDelete(void);
void* DIADCCompressorNew(void);
void* DIAddPermission(void);
void* DIAddRunToBLKX(void);
void* DIAttachDrive(void);
void* DIAttachImage(void);
void* DIAuthOpen(void);
void* DIBackingStoreAddRsrcFork(void);
void* DIBackingStoreAllowExpandability(void);
void* DIBackingStoreCanEnumerateDirectory(void);
void* DIBackingStoreChangeKey(void);
void* DIBackingStoreCloseDataFork(void);
void* DIBackingStoreCloseResourceFile(void);
void* DIBackingStoreCloseRsrcFork(void);
void* DIBackingStoreCopyAttr(void);
void* DIBackingStoreCopyEncryptedInformation(void);
void* DIBackingStoreDelete(void);
void* DIBackingStoreEnumerateDirectory(void);
void* DIBackingStoreFlush(void);
void* DIBackingStoreFlushWithFlags(void);
void* DIBackingStoreGetBaseBackingStore(void);
void* DIBackingStoreGetDataForkLength(void);
void* DIBackingStoreGetExpandability(void);
void* DIBackingStoreGetExtension(void);
void* DIBackingStoreGetFileCreator(void);
void* DIBackingStoreGetFileType(void);
void* DIBackingStoreGetMaxDataForkLength(void);
void* DIBackingStoreGetMaxRsrcForkLength(void);
void* DIBackingStoreGetName(void);
void* DIBackingStoreGetPath(void);
void* DIBackingStoreGetRsrcForkLength(void);
void* DIBackingStoreGetURL(void);
void* DIBackingStoreGetURLArray(void);
void* DIBackingStoreGetUniqueIdentifier(void);
void* DIBackingStoreHandleIdle(void);
void* DIBackingStoreHandlePowerChange(void);
void* DIBackingStoreHasEncryptedEncoding(void);
void* DIBackingStoreHasFileCreator(void);
void* DIBackingStoreHasFileType(void);
void* DIBackingStoreIsEncrypted(void);
void* DIBackingStoreIsRemote(void);
void* DIBackingStoreIsWriteEnabled(void);
void* DIBackingStoreNewWithCFURL(void);
void* DIBackingStoreOnLockedMedia(void);
void* DIBackingStoreOpenDataFork(void);
void* DIBackingStoreOpenResourceFile(void);
void* DIBackingStoreOpenRsrcFork(void);
void* DIBackingStoreReadDataFork(void);
void* DIBackingStoreReadRsrcFork(void);
void* DIBackingStoreSetAttr(void);
void* DIBackingStoreSetDataForkLength(void);
void* DIBackingStoreSetExpandability(void);
void* DIBackingStoreSetFileCreator(void);
void* DIBackingStoreSetFileType(void);
void* DIBackingStoreSetPermission(void);
void* DIBackingStoreSetRsrcForkLength(void);
void* DIBackingStoreUnlink(void);
void* DIBackingStoreWriteDataFork(void);
void* DIBackingStoreWriteRsrcFork(void);
void* DIChecksumDelete(void);
void* DIChecksumGetBitCount(void);
void* DIChecksumGetChecksumStruct(void);
void* DIChecksumGetChecksumType(void);
void* DIChecksumGetLongName(void);
void* DIChecksumGetShortName(void);
void* DIChecksumGetValue(void);
void* DIChecksumGetValueString(void);
void* DIChecksumHDIChecksumAreEqual(void);
void* DIChecksumIsEmpty(void);
void* DIChecksumIsEqual(void);
void* DIChecksumNewOfSameKindAs(void);
void* DIChecksumNewUsingChecksumStruct(void);
void* DIChecksumNewWith(void);
void* DIChecksumProcessBuffer(void);
void* DIChecksumProcessConstant(void);
void* DIChecksumProcessFinish(void);
void* DIChecksumProcessStart(void);
void* DIChecksumSetValue(void);
void* DICopyDevEntries(void);
void* DICopyDiskImageMountPointDictionary(void);
void* DICopyIdentifiableFileSystemsInfo(void);
void* DICopyStrError(void);
void* DICopyStrError_real(void);
void* DICopyWriteableFileSystemsArray(void);
void* DICreateBackingStore(void);
void* DICreateDiskImage(void);
void* DICreateNewUDIFSegmentURL(void);
void* DICreatePermissionDictionary(void);
void* DIDARTDiskImageGetDartFileHeader(void);
void* DIDeinitialize(void);
void* DIDevEntryCopyDeviceInfo(void);
void* DIDevEntryGetInformation(void);
void* DIDevEntryToIOKitObject(void);
void* DIDevEntryToRawDevice(void);
void* DIDiskCopy42DiskImageGetDiskCopy42Header(void);
void* DIDiskImageAttach(void);
void* DIDiskImageBurn(void);
void* DIDiskImageCalcChecksum(void);
void* DIDiskImageCallProgressCancelProc(void);
void* DIDiskImageCallProgressMessageProc(void);
void* DIDiskImageCallProgressPercentProc(void);
void* DIDiskImageCanBeAppended(void);
void* DIDiskImageCanBeBurned(void);
void* DIDiskImageCancelNow(void);
void* DIDiskImageChangeKey(void);
void* DIDiskImageCompact(void);
void* DIDiskImageContentResize(void);
void* DIDiskImageConvertWithDiskImage(void);
void* DIDiskImageCopyChecksumReportString(void);
void* DIDiskImageCopyFormatDescriptionString(void);
void* DIDiskImageCopyIconURL(void);
void* DIDiskImageCopyImageChecksum(void);
void* DIDiskImageCopyImageInformation(void);
void* DIDiskImageCopyKernelAttachDictionary(void);
void* DIDiskImageCopyMountPointDictionary(void);
void* DIDiskImageCopyNonKernelAttachDictionary(void);
void* DIDiskImageCopyResizeInformation(void);
void* DIDiskImageCopySLADictionary(void);
void* DIDiskImageCreateChecksum(void);
void* DIDiskImageCreateDRTrackForImage(void);
void* DIDiskImageDelete(void);
void* DIDiskImageEstimateSectorsNeededForBurn(void);
void* DIDiskImageFlush(void);
void* DIDiskImageGetBackingStore(void);
void* DIDiskImageGetImageFormat(void);
void* DIDiskImageGetSectorCount(void);
void* DIDiskImageGetUniqueIDDict(void);
void* DIDiskImageGetVirtualBandSize(void);
void* DIDiskImageHandleIdle(void);
void* DIDiskImageHandlePowerChange(void);
void* DIDiskImageHasChecksum(void);
void* DIDiskImageHasPartitionMap(void);
void* DIDiskImageHasValidChecksum(void);
void* DIDiskImageInUse(void);
void* DIDiskImageIsEncrypted(void);
void* DIDiskImageIsHFS(void);
void* DIDiskImageIsHFSPlus(void);
void* DIDiskImageIsHFSPlusWithWrapper(void);
void* DIDiskImageIsHFSX(void);
void* DIDiskImageIsISO9660(void);
void* DIDiskImageIsKernelCompatible(void);
void* DIDiskImageIsMFS(void);
void* DIDiskImageIsProDOS(void);
void* DIDiskImageIsUDF(void);
void* DIDiskImageIsUFS(void);
void* DIDiskImageIsWriteEnabled(void);
void* DIDiskImageObjectCallDIProgressCallBackProc(void);
void* DIDiskImageObjectGetClassName(void);
void* DIDiskImageObjectGetDIProgressCallBackProcPtr(void);
void* DIDiskImageObjectGetProperty(void);
void* DIDiskImageObjectGetRefCon(void);
void* DIDiskImageObjectRelease(void);
void* DIDiskImageObjectRetain(void);
void* DIDiskImageObjectSetDIProgressCallBackProcPtr(void);
void* DIDiskImageObjectSetProperty(void);
void* DIDiskImageObjectSetRefCon(void);
void* DIDiskImageReadSectors(void);
void* DIDiskImageSetProgressCancelProcPtr(void);
void* DIDiskImageSetProgressMessageProcPtr(void);
void* DIDiskImageSetProgressPercentProcPtr(void);
void* DIDiskImageSetSectorCount(void);
void* DIDiskImageValidateChecksum(void);
void* DIDiskImageValidateChecksumWithFlags(void);
void* DIDiskImageWriteSectors(void);
void* DIEnableSecureMode(void);
void* DIEnumerateCarbonVolNames(void);
void* DIEnumerateMountPoints(void);
void* DIEnumerateVRefNums(void);
void* DIEnumerateWholeDiskDevEntries(void);
void* DIGetBackingStorePluginCount(void);
void* DIGetBundleRef(void);
void* DIGetDebugLevel(void);
void* DIGetDevEntryInTree(void);
void* DIGetDiskImagePluginCount(void);
void* DIGetDriverVersion(void);
void* DIGetFileEncodingPluginCount(void);
void* DIGetFrameworkVersion(void);
void* DIGetLocalKey(void);
void* DIGetPermission(void);
void* DIGetPluginPropertyDicts(void);
void* DIGetVerboseLevel(void);
void* DIHLCopyEncryptedStatus(void);
void* DIHLCopyImageForVolume(void);
void* DIHLCopyPreference(void);
void* DIHLCopyPreferences(void);
void* DIHLCopyResizeInfo(void);
void* DIHLCopyStatusStageString(void);
void* DIHLCopyVolumeForImage(void);
void* DIHLCopyVolumeRefNumDiskImageInfo(void);
void* DIHLDiskImageAttach(void);
void* DIHLDiskImageChangePassword(void);
void* DIHLDiskImageCompact(void);
void* DIHLDiskImageCopyProperties(void);
void* DIHLDiskImageCreate(void);
void* DIHLDiskImageProbeCatalogInfo(void);
void* DIHLDiskImageProbeURL(void);
void* DIHLDiskImageSetProperty(void);
void* DIHLEraseImageKeys(void);
void* DIHLFVChangeMasterPassword(void);
void* DIHLFVChangePassword(void);
void* DIHLFVCompact(void);
void* DIHLFVCopyEncryptionIdentities(void);
void* DIHLFVCreate(void);
void* DIHLFVMakeMasterPassword(void);
void* DIHLFVMasterPasswordEnabled(void);
void* DIHLFVMasterPasswordValidates(void);
void* DIHLFVMount(void);
void* DIHLFVResize(void);
void* DIHLFVSetAltPassword(void);
void* DIHLFVUnmount(void);
void* DIHLGetDefaultsDictionary(void);
void* DIHLResizeImage(void);
void* DIIOKitObjectCopyDeviceInfo(void);
void* DIIOKitObjectToDevEntry(void);
void* DIInitialize(void);
void* DIIsInitialized(void);
void* DIIsPotentiallyValidDiskImage(void);
void* DIKenCodeCompressorCalculateBufferSize(void);
void* DIKenCodeCompressorCompressData(void);
void* DIKenCodeCompressorDelete(void);
void* DIKenCodeCompressorNew(void);
void* DILoadDriver(void);
void* DIMakeStubBLKX(void);
void* DIMediaKitCreateMKMediaRef(void);
void* DIMediaKitVectorProc(void);
void* DIMediaKitVectorProcWithOffset(void);
void* DIMountPointGetInformation(void);
void* DINDIFDiskImageGetNDIFHeader(void);
void* DIPartitionSchemeScan(void);
void* DIRawDevEntryToBlockDevice(void);
void* DIResolveBackingStoreToDiskImage(void);
void* DIResolvePathsToDiskImage(void);
void* DIResolvePathsToDiskImageWithOptions(void);
void* DIResolveURLToBackingStore(void);
void* DIResolveURLToDiskImage(void);
void* DIResourceFileAddResource(void);
void* DIResourceFileChangedResource(void);
void* DIResourceFileCopyResourcesFrom(void);
void* DIResourceFileCopyXMLRepresentation(void);
void* DIResourceFileCountResources(void);
void* DIResourceFileCountTypes(void);
void* DIResourceFileCreateWithXMLRepresentation(void);
void* DIResourceFileDeleteAllResources(void);
void* DIResourceFileDeleteAllResourcesOfType(void);
void* DIResourceFileDetachResource(void);
void* DIResourceFileGetIndResource(void);
void* DIResourceFileGetIndType(void);
void* DIResourceFileGetResAttrs(void);
void* DIResourceFileGetResInfo(void);
void* DIResourceFileGetResource(void);
void* DIResourceFileReleaseResource(void);
void* DIResourceFileSetResAttrs(void);
void* DIResourceFileSetResInfo(void);
void* DIResourceFileUpdateResFile(void);
void* DIResourceFileWriteResource(void);
void* DISetDebugLevel(void);
void* DISetVerboseLevel(void);
void* DIShadowedDiskImageCopyDefaultShadowFileURL(void);
void* DIShadowedDiskImageCreateDefaultShadowFileName(void);
void* DIShadowedDiskImageNewWithDiskImageAndShadowURL(void);
void* DIStrError(void);
void* DIStrError_r(void);
void* DISubDiskImageCreateNewWithDiskImage(void);
void* DIUDIFDiskImageGetBLKX(void);
void* DIUDIFDiskImageGetBLKXStartingAt(void);
void* DIUDIFDiskImageGetImageVariant(void);
void* DIUDIFDiskImageGetUDIFFileHeader(void);
void* DIUDIFFileAccessAppendData(void);
void* DIUDIFFileAccessCloseFile(void);
void* DIUDIFFileAccessCreateWithCFURL(void);
void* DIUDIFFileAccessDelete(void);
void* DIUDIFFileAccessDeleteFile(void);
void* DIUDIFFileAccessFlattenFile(void);
void* DIUDIFFileAccessFlattenFileWithEmbedOptions(void);
void* DIUDIFFileAccessGetBackingStore(void);
void* DIUDIFFileAccessGetHeaderStyle(void);
void* DIUDIFFileAccessGetResourceFile(void);
void* DIUDIFFileAccessGetUDIFFileHeader(void);
void* DIUDIFFileAccessNewWithCFURL(void);
void* DIUDIFFileAccessOpenFile(void);
void* DIUDIFFileAccessSetMaxSectorsPerSegment(void);
void* DIUDIFFileAccessUnflattenFile(void);
void* DIUDIFFileAccessUpdateHeader(void);
void* DIUDIFFileAccessWriteResourceFile(void);
void* DIUDIFFileAccessWriteResourceFileAsCarbonResourceFork(void);
void* DIUDIFFileAccessWriteResourceFileAsXML(void);
void* DIVRefNumGetInformation(void);
void* DI_kextConnect(void);
void* DI_kextCreateDrive(void);
void* DI_kextCreateDriveInKernel(void);
void* DI_kextDisconnect(void);
void* DI_kextDriveActivate(void);
void* DI_kextDriveConnect(void);
void* DI_kextDriveDisconnect(void);
void* DI_kextDriveGetRequest(void);
void* DI_kextDrivePutReply(void);
void* DI_kextDriveRegisterClientBuffer(void);
void* DI_kextExists(void);
void* DI_kextTestNetBootHook(void);
void* DI_kextWaitQuiet(void);
void* DI_logBuffer(void);
void* DI_logDARTHeader(void);
void* DI_logDiskCopy42Header(void);
void* DI_logHDIChecksum(void);
void* DI_logHDIReply64(void);
void* DI_logHDIRequest64(void);
void* DI_logHDISegmentID(void);
void* DI_logHFSPlusForkData(void);
void* DI_logMDB(void);
void* DI_logMDB_to_file(void);
void* DI_logNDIFHeader(void);
void* DI_logNDIFSegmentInfo(void);
void* DI_logNDIFSourceSubTable(void);
void* DI_logUDIFFileHeader(void);
void* DI_logUDIFPartitionList(void);
void* DI_logUDIFRun(void);
void* DI_logUDIFblkx(void);
void* DI_logUDIFblkx_ptr(void);
void* DI_logVH(void);
void* DI_logVH_to_file(void);
void* MKCalculatePartitionParameters(void);
void* MKCopyDefaultLayouts(void);
void* MKCopyLayoutInfoArrayWithOverhead(void);

CF_EXTERN_C_END
CF_IMPLICIT_BRIDGING_DISABLED
